<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/commons/global.jsp" %>
<script type="text/javascript">
	var sysLogDataGrid;

    $(function () { 	
    	
        $('#operLogDataGrid').datagrid({
            url: '${path }/operlog/dataGrid',
            striped: true,
            pagination: true,
            singleSelect: true,
            idField: 'operId',
            pageSize: 20,
            pageList: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500],
            columns: [[{
                width: '80',
                title: '模块标题',
                field: 'title',
                sortable: true
            },{
                width: '180',
                title: '事件类型',
                field: 'method',
                sortable: true
            },
               {
                width: '80',
                title: '操作员名称',
                field: 'loginName',
                sortable: true
            }, {
                width: '80',
                title: '请求url',
                field: 'operUrl'
            }, {
                width: '100',
                title: 'IP地址',
                field: 'operIp',
                sortable: true
            }, {
                width: '80',
                title: '事件结果',
                field: 'status',
                sortable : true,
                     formatter : function(value, row, index) {
                         switch (value) {
                         case 0:
                             return '正常';
                         case 1:
                             return '异常';
                         }
                     }
            }, {
                width: '130',
                title: '创建时间',
                field: 'operTime'
            }]]
        });
    });
    function searchUserFun() {

    	$('#operLogDataGrid').datagrid('load', $.serializeObject($('#operlogForm')));
    }
    function cleanUserFun() {
        $('#operlogForm input').val('');
        operLogDataGrid.datagrid('load', {});
    }
    function excel(){
	window.location.href = "${path }/operlog/execlAll";
}

</script>
<div class="easyui-layout" data-options="fit:true,border:false">
 <div data-options="region:'north',border:false" style="height: 30px; overflow: hidden;background-color: #fff">
        <form id="operlogForm">
            <table>
                <tr>
                    <th>姓名:</th>
                    <td><input name="loginName" placeholder="请输入用户姓名"/></td>
                      <th>IP地址:</th>
                    <td><input name="operIp" placeholder="请输入用户IP地址"/></td>
                    <th>创建时间:</th>
                    <td>
                        <input class="Wdate" name="createdateStart" placeholder="点击选择时间" onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly" />至
                        <input class="Wdate" name="createdateEnd" placeholder="点击选择时间" onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly" />
                        <a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'glyphicon-search',plain:true" onclick="searchUserFun();">查询</a>
                        <a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'glyphicon-remove-circle',plain:true" onclick="cleanUserFun();">清空</a>
                         <a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'glyphicon-remove-circle',plain:true" onclick="excel();">导出excel</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <div data-options="region:'center',border:false">
        <table id="operLogDataGrid" data-options="fit:true,border:false"></table>
    </div>
</div>